﻿@{
    Layout = "_CustomerLayout";
    ViewData["Title"] = "订单信息";
    var customerorder = Model;
    ViewData["Name"] = customerorder[0].Cname;
}
<link href="~/assets/css/bootstrap.css" rel="stylesheet" />
<!-- FONT AWESOME STYLE  -->
<link href="~/assets/css/font-awesome.css" rel="stylesheet" />
<!-- DATATABLE STYLE  -->
<link href="~/assets/js/dataTables/dataTables.bootstrap.css" rel="stylesheet" />
<!-- CUSTOM STYLE  -->
<link href="~/assets/css/style.css" rel="stylesheet" />
<!-- GOOGLE FONT -->

<div class="col-12">
    <!-- Advanced Tables -->
    <div class="panel panel-default">
        <div class="panel-heading">
            个人订单
        </div>
        <div class="panel-body">
            <table class="table table-striped table-bordered table-hover dataTable no-footer" id="dataTables-example" aria-describedby="dataTables-example_info">
                <thead>
                    <tr role="row">
                        <th class="sorting_asc" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1">订单编号</th>
                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1">书名</th>
                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1">购买数量</th>
                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1">单价</th>
                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1">总价</th>
                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1">下单日期</th>
                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1">地址</th>
                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1">状态</th>
                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1">订单处理</th>
                    </tr>
                </thead>
                <tbody>
                    @for (int i = 0; i < customerorder.Count; i++)
                    {
                        if ((customerorder[i].OrderState == "退书中") || (customerorder[i].BookNumber == 0) || (customerorder[i].OrderState == "已收货") || (customerorder[i].OrderState == "已退货"))
                        {
                            <tr class="gradeA odd">
                                <td class="sorting_1">@customerorder[i].Id</td>
                                <td class="center">@customerorder[i].BookName</td>
                                <td class="center">@customerorder[i].BookNumber</td>
                                <td class="sorting_1">@customerorder[i].BookPrice</td>
                                <td class="sorting_1">@customerorder[i].TotalPrice</td>
                                <td class="sorting_1">@customerorder[i].OrderTime</td>
                                <td class="center">@customerorder[i].Address</td>
                                <td class="center">@customerorder[i].OrderState</td>
                                <td></td>
                            </tr>
                        }
                        else
                        {
                            var Id = @customerorder[i].Id;
                            <tr class="gradeA odd">
                                <td class="sorting_1">@customerorder[i].Id</td>
                                <td class="center">@customerorder[i].BookName</td>
                                <td class="center">@customerorder[i].BookNumber</td>
                                <td class="sorting_1">@customerorder[i].BookPrice</td>
                                <td class="sorting_1">@customerorder[i].TotalPrice</td>
                                <td class="sorting_1">@customerorder[i].OrderTime</td>
                                <td class="center">@customerorder[i].Address</td>
                                <td class="center">@customerorder[i].OrderState</td>
                                <td><a href="/Customer/ReturnBook?id=@Id">退书</a>&nbsp;&nbsp;<a href="/Customer/ReceiveBook?id=@Id">确认收货</a></td>
                            </tr>
                        }

                    }
                </tbody>
            </table>
        </div>
    </div>

</div>
@section Scripts{
    <script src="~/assets/js/jquery-1.10.2.js"></script>
    <!-- BOOTSTRAP SCRIPTS  -->
    <script src="~/assets/js/bootstrap.js"></script>
    <!-- DATATABLE SCRIPTS  -->
    <script src="~/assets/js/dataTables/jquery.dataTables.js"></script>
    <script src="~/assets/js/dataTables/dataTables.bootstrap.js"></script>
    <!-- CUSTOM SCRIPTS  -->
    <script src="~/assets/js/custom.js"></script>
}
